Skip to content

improve: optimize Docker build for faster CI and smaller image#193

Merged
coji merged 2 commits intomainfrom
improve/docker-build
Mar 16, 2026
Merged

improve: optimize Docker build for faster CI and smaller image#193
coji merged 2 commits intomainfrom
improve/docker-build

Conversation

@coji
Copy link
Owner

@coji coji commented Mar 16, 2026

Summary

  • Split base into build-base (build-essential, python3) and runtime-base (sqlite3, atlas, vim) — build tools excluded from production image
  • Change GHA cache mode=minmode=max to cache all intermediate stages (base, deps, production-deps)
  • Add opensrc/, .git/, .github/ to .dockerignore to reduce build context
  • Fix legacy ENV key value format warnings

Impact

  • Image size: 1.40 GB → 1.09 GB (-22%)
  • CI with warm cache: only pnpm build + COPY layers need to rebuild on source changes (~30s vs ~2min)
  • No-cache build: comparable (~1:27 vs ~1:32, base stages now parallel)

Test plan

  • Local docker build succeeds
  • better-sqlite3, atlas, sqlite3 all work in production image
  • CI build completes and deploys successfully

🤖 Generated with Claude Code

- Split base into build-base (build-essential, python3) and runtime-base
  (sqlite3, atlas, vim) so build tools are excluded from production image
- Change GHA cache mode from min to max to cache all intermediate stages
- Add opensrc/, .git/, .github/ to .dockerignore to reduce build context
- Fix legacy ENV format warnings

Image size: 1.40GB → 1.09GB (-22%)
CI with cache: base stages cached, only rebuild on source changes (~30s)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 16, 2026

Warning

Rate limit exceeded

@coji has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 10 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fda3fd73-c783-428d-9646-e504620823d9

📥 Commits

Reviewing files that changed from the base of the PR and between 8fa3305 and 14339c3.

📒 Files selected for processing (5)
  • .dockerignore
  • .github/workflows/deploy.yml
  • .node-version
  • Dockerfile
  • package.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch improve/docker-build
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

- Add .node-version (24.14.0) as source of truth for Node version
- Add packageManager field (pnpm@10.32.1) to package.json
- Bump Dockerfile ARGs to match: Node 24.12.0→24.14.0, pnpm 10.26.2→10.32.1
- Remove hardcoded version/node-version from CI workflow steps
  (pnpm/action-setup reads packageManager, setup-node reads .node-version)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coji coji merged commit ac2381b into main Mar 16, 2026
6 checks passed
@coji coji deleted the improve/docker-build branch March 16, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant